const mongoose = require('mongoose');
const bcrypt = require('bcryptjs');

const Schema = mongoose.Schema,
    ObjectId = Schema.ObjectId;

/**
 * 客户表示一个企业级用户
 * @type {mongoose.Schema}
 */
let schema = new Schema({
    request_id : ObjectId,
    account         : String,
    mobile        : String,
    content            : String,
    charge_count    : Number,
    ref       : String,
    mt_msg_id : String,
    cus_msg_id : String,
    ext : String,
    create_time : {type : Date, default : Date.now},
    send_time : {type : Date},
    report_time : Date,
    report_status : {type : Number, default : 0}, //0=无状态，1=成功，2=失败
    report_desc : {type : String},
    status : {type : Number, default : 0}  //0=未发送，1=已发送，2=提交失败

});

let model = mongoose.model('mt_msg_history', schema);

module.exports = model;
